home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat3 / Tcl / linkvar.z / linkvar
Encoding:
Text File  |  1998-10-30  |  6.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4. TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr((((3333TTTTccccllll))))                                            TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr((((3333TTTTccccllll))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tcl_LinkVar, Tcl_UnlinkVar - link Tcl variable to C variable
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttccccllll....hhhh>>>>
  13.  
  14.      int
  15.      TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr(_i_n_t_e_r_p, _v_a_r_N_a_m_e, _a_d_d_r, _t_y_p_e)
  16.  
  17.      TTTTccccllll____UUUUnnnnlllliiiinnnnkkkkVVVVaaaarrrr(_i_n_t_e_r_p, _v_a_r_N_a_m_e)
  18.  
  19. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  20.      Tcl_Interp   *_i_n_t_e_r_p    (in)      Interpreter that contains _v_a_r_N_a_m_e.
  21.                                        Also used by TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr to return
  22.                                        error messages.
  23.  
  24.      char         *_v_a_r_N_a_m_e   (in)      Name of global variable.
  25.  
  26.      char         *_a_d_d_r      (in)      Address of C variable that is to be
  27.                                        linked to _v_a_r_N_a_m_e.
  28.  
  29.      int          _t_y_p_e       (in)      Type of C variable.  Must be one of
  30.                                        TCL_LINK_INT, TCL_LINK_DOUBLE,
  31.                                        TCL_LINK_BOOLEAN, or TCL_LINK_STRING,
  32.                                        optionally OR'ed with
  33.                                        TCL_LINK_READ_ONLY to make Tcl variable
  34.                                        read-only.
  35.  
  36.  
  37. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  38.      TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr uses variable traces to keep the Tcl variable named by
  39.      _v_a_r_N_a_m_e in sync with the C variable at the address given by _a_d_d_r.
  40.      Whenever the Tcl variable is read the value of the C variable will be
  41.      returned, and whenever the Tcl variable is written the C variable will be
  42.      updated to have the same value.  TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr normally returns TCL_OK;  if
  43.      an error occurs while setting up the link (e.g. because _v_a_r_N_a_m_e is the
  44.      name of array) then TCL_ERROR is returned and _i_n_t_e_r_p->_r_e_s_u_l_t contains an
  45.      error message.
  46.  
  47.      The _t_y_p_e argument specifies the type of the C variable, and must have one
  48.      of the following values, optionally OR'ed with TCL_LINK_READ_ONLY:
  49.  
  50.      TTTTCCCCLLLL____LLLLIIIINNNNKKKK____IIIINNNNTTTT
  51.           The C variable is of type iiiinnnntttt.  Any value written into the Tcl
  52.           variable must have a proper integer form acceptable to TTTTccccllll____GGGGeeeettttIIIInnnntttt;
  53.           attempts to write non-integer values into _v_a_r_N_a_m_e will be rejected
  54.           with Tcl errors.
  55.  
  56.      TTTTCCCCLLLL____LLLLIIIINNNNKKKK____DDDDOOOOUUUUBBBBLLLLEEEE
  57.           The C variable is of type ddddoooouuuubbbblllleeee.  Any value written into the Tcl
  58.           variable must have a proper real form acceptable to TTTTccccllll____GGGGeeeettttDDDDoooouuuubbbblllleeee;
  59.           attempts to write non-real values into _v_a_r_N_a_m_e will be rejected with
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr((((3333TTTTccccllll))))                                            TTTTccccllll____LLLLiiiinnnnkkkkVVVVaaaarrrr((((3333TTTTccccllll))))
  71.  
  72.  
  73.  
  74.           Tcl errors.
  75.  
  76.      TTTTCCCCLLLL____LLLLIIIINNNNKKKK____BBBBOOOOOOOOLLLLEEEEAAAANNNN
  77.           The C variable is of type iiiinnnntttt.  If its value is zero then it will
  78.           read from Tcl as ``0''; otherwise it will read from Tcl as ``1''.
  79.           Whenever _v_a_r_N_a_m_e is modified, the C variable will be set to a 0 or 1
  80.           value.  Any value written into the Tcl variable must have a proper
  81.           boolean form acceptable to TTTTccccllll____GGGGeeeettttBBBBoooooooolllleeeeaaaannnn;  attempts to write non-
  82.           boolean values into _v_a_r_N_a_m_e will be rejected with Tcl errors.
  83.  
  84.      TTTTCCCCLLLL____LLLLIIIINNNNKKKK____SSSSTTTTRRRRIIIINNNNGGGG
  85.           The C variable is of type cccchhhhaaaarrrr ****.  If its value is not null then it
  86.           must be a pointer to a string allocated with mmmmaaaalllllllloooocccc.  Whenever the
  87.           Tcl variable is modified the current C string will be freed and new
  88.           memory will be allocated to hold a copy of the variable's new value.
  89.           If the C variable contains a null pointer then the Tcl variable will
  90.           read as ``NULL''.
  91.  
  92.      If the TCL_LINK_READ_ONLY flag is present in _t_y_p_e then the variable will
  93.      be read-only from Tcl, so that its value can only be changed by modifying
  94.      the C variable.  Attempts to write the variable from Tcl will be rejected
  95.      with errors.
  96.  
  97.      TTTTccccllll____UUUUnnnnlllliiiinnnnkkkkVVVVaaaarrrr removes the link previously set up for the variable given
  98.      by _v_a_r_N_a_m_e.  If there does not exist a link for _v_a_r_N_a_m_e then the
  99.      procedure has no effect.
  100.  
  101.  
  102. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  103.      boolean, integer, link, read-only, real, string, variable
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.